package com.yf.stat.modules.total.controller;

import com.yf.base.api.api.ApiRest;
import com.yf.base.api.api.controller.BaseController;
import com.yf.stat.modules.total.dto.StatTotalNumDTO;
import com.yf.stat.modules.total.mapper.StatTotalNumMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* <p>
* 用户统计控制器
* </p>
*
* @author 聪明笨狗
* @since 2021-06-04 08:28
*/
@Api(tags={"系统计数"})
@RestController
@RequestMapping("/api/stat/total/num")
public class StatTotalNumController extends BaseController {

    @Autowired
    private StatTotalNumMapper statTotalNumMapper;

    /**
     * 查找最近一周数据，用于控制台图表显示
     * @return
     */
    @ApiOperation(value = "查找系统计数")
    @PostMapping("/all")
    public ApiRest<StatTotalNumDTO> week() {
        StatTotalNumDTO respDTO = statTotalNumMapper.findStatNums();
        return super.success(respDTO);
    }

}
